Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PoC of profiles support #196

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

jscotka
Copy link
Collaborator

@jscotka jscotka commented Jul 25, 2023

This PoC shows how the profiles could be solved.
Main idea there is that there are external YAML data passed to profile apply. It is similar to adjust and uses similar functions.
external yaml contains definition where it is applied (go thru all leaf nodes) and then _merge_special method is called and all other keys are applied.
With extension for "?" mark to apply something if not defined.

It solves several use cases:

  • be able to add/append/remove/override some steps
    • e.g. able to change provision method
    • e.g. add some extra provision steps
  • It is generic, so that you have to define the selector where to define where you want to apply data, e.g. plan is defined as execute is defined and discovery is defined
plan1_definition:
  where: execute is defined cc and discover is defined
  # append to prepare phase
  prepare+:
    name: some name
    how: shell
    script: systemctl start httpd
   # create reporting if not defined
  report?:
    how: html
    open: true

   # override provision by own definition
  provision:
    how: virtual
    image: fedora-37


test1_definition:
  where: summary is defined and test is defined
  new_attribute: hello world
  test+: appended

@jscotka jscotka requested review from psss and happz July 27, 2023 07:40
@LecrisUT
Copy link
Contributor

How is this different then applying the profile yaml as a main.fmf? Maybe it has overlap with setting system/user/project metadata file/tree

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants